Beginning GraphQL: Fetch data faster and more efficiently whilst improving the overall performance of your web application by Brian Kimokoti

Beginning GraphQL: Fetch data faster and more efficiently whilst improving the overall performance of your web application by Brian Kimokoti

Author:Brian Kimokoti [Kimokoti, Brian]
Language: eng
Format: epub
Tags: COM060160 - COMPUTERS / Web / Web Programming, COM060080 - COMPUTERS / Web / General, COM051010 - COMPUTERS / Programming Languages / General
Publisher: Packt Publishing
Published: 2018-07-25T23:00:00+00:00


functions:

hello:

handler:

code: src/hello.js

type: resolver

schema: src/hello.graphql

Each resolver can add a single query or mutation field to the GraphQL API, and this field takes in scalar arguments and returns a type that is specified in the same Schema Definition Language (SDL) document. The limitation is that only one query or mutation field can be added and the input can only be a scalar type.

Hooks: These execute before or after an API operation has been executed. They are mostly used to validate request data and format responses. Two types of hook points exist, operationBefore and operationAfter, and they are invoked before and after a write to the database, respectively. Hook functions need to specify an additional operation field that contains the model and specific database operation, for example, User.create. The following shows an example of an operationBefore hook that is executed before a user is created:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.